package com.pacy.pacybaseproject.activitys.routing;

import android.graphics.Color;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.Nullable;

import com.fondesa.recyclerviewdivider.DividerBuilder;
import com.pacy.pacybaseproject.BR;
import com.pacy.pacybaseproject.R;
import com.pacy.pacybaseproject.activitys.MsgListActivity;
import com.pacy.pacybaseproject.databinding.RoutingBusFragmentBinding;
import com.pacy.pacybaseproject.fragments.BusFragment;
import com.pacy.pacybaseproject.viewmodels.RoutingBusViewModel;

import me.goldze.mvvmhabit.base.BaseFragment;

/**
 * @author PACY
 * @date 2024/3/4
 * description:
 */
public class RoutingBusFragment extends BaseFragment<RoutingBusFragmentBinding, RoutingBusViewModel> {

    public static RoutingBusFragment newInstance(String title) {

        Bundle args = new Bundle();
        args.putString("title", title);
        RoutingBusFragment fragment = new RoutingBusFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.routing_bus_fragment;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initData() {
        super.initData();
        if (binding.recyclerView.getItemDecorationCount() == 0) {
            new DividerBuilder(getContext())
                    .size(15, TypedValue.COMPLEX_UNIT_DIP)
                    .color(Color.TRANSPARENT)
                    .showFirstDivider()
                    .showLastDivider()
                    .build().addTo(binding.recyclerView);
        }
    }
}
